package middleware

import "github.com/caarlos0/env/v6"

var (
	config *AuditSendorConfig
)

func LoadConfigFromEnv() (*AuditSendorConfig, error) {
	// os.Getenv("MYSQL_DB")
	conf := NewAuditSendorConfig()
	err := env.Parse(conf)
	if err != nil {
		return nil, err
	}
	// 赋值给全局变量
	config = conf
	return conf, nil
}
